<!-- 新闻管理 -->
<template>
  <div class="page-box h100 display-flex czbj">
    <p class="title-label">新闻管理</p>
    <div class="btm mt10 pt10">
      <dxtable
        :dataJson="dataJson"
        :portUrl="portUrl"
        :qx="qx"
        :headBtn="headBtn"
        ref="databale"
        :formJson="formJson"
        imgkuTitle="新闻图片"
      ></dxtable>
    </div>
  </div>
</template>
 <script lang='ts' setup>
import dxtable from "../../../components/util/dxtable.vue";
import sort from "../../../components/util/sort.vue";
import { NSwitch } from "naive-ui";
import { dxget, dxpost, qurl } from "../../../util/index";
import { h, ref, reactive } from "vue";
const cz = qurl();
const databale = ref();
const initeer = () => {
  databale.value.initDataExpose();
};
const props = defineProps({
  pup: { type: String },
});
const emit = defineEmits(["callBack"]);
// 弹窗公用该列表
let dataJson = [
  {
    title: "id",
    key: "id",
    width: 80,
  },
  {
    title: "新闻名称",
    key: "title",
    width:"400",
    search: true, // 是否在搜索栏展示
  },
  {
    title: "新闻链接",
    key: "url",
  },
  {
    title: "新闻图片",
    render(row) {
      return h("img", { class: "fjhnser", src: row.fm });
    },
  },

  {
    title: "排序",
    width: 100,
    render(row) {
      row.databaseName = "kxnew";
      return h(sort, {
        row,
        onCallBack: () => {
          initeer();
        },
      });
    },
  },
  {
    title: "创建时间",
    key: "addTime",
    width: "120",
  },
];
let portUrl = "kx/kxnew";
let headBtn = [];
const qx = {
  DeletePermissionID: "kxnewsManagementdel", //删除
  EditPermissionIdentifier: "kxnewsManagementbj", // 编辑
  NewPermissionIdentifier: "kxnewsManagementxz", // 新建
  ViewPermissionID: "kxnewsManagementck", // 查看
};

let formJson = reactive([
  {
    title: "新闻名称",
    key: "title",
    type: "input",
  },
  {
    title: "新闻链接",
    key: "url",
    type: "input",
  },
  {
    title: "新闻图片",
    key: "fm",
    type: "img",
  },
]);
</script>
 <style scoped>
</style>


